//
//  SEDoctorModel.swift
//  SmartEyeForPatient
//
//  Created by QDSG on 2021/4/21.
//

import HandyJSON

enum SEDoctorOnlineStatus: Int, HandyJSONEnum {
    case online, offline, closed
    
    var text: String {
        switch self {
        case .online: return "·在线"
        case .offline: return "·离线"
        case .closed: return "·停诊"
        }
    }
    
    var textColor: UIColor {
        switch self {
        case .online: return Asset.main.color
        case .offline: return Asset.textLight.color
        case .closed: return Asset.warn.color
        }
    }
}

struct SEDoctorModel: HandyJSON {
    var pageNum: Int = 0
    var pageSize: Int = 0
    var total: Int = 0
    var totalPage: Int = 0
    
    var list: [SEDoctorDetail]?
}

struct SEDoctorDetail: HandyJSON {
    var id: String?
    var name: String?
    var jobTitle: String?
    var introduction: String?
    var speciality: String?
    var fee: Double?
    var hospitalName: String?
    var deptName: String?
    var imgPath: String?
    var count: Int = 0
    var hospitalId: String?
    var addr: String?
    var province: String?
    var city: String?
    var region: String?
    var deptId: String?
    var enName: String?
    var idCard: String?
    var phone: String?
    /// 医生个人二维码图片路径
    var qrCode: String?
    /// 审方权限: 1-有 0-无 默认0
    var isAudit: Int = 0
    /// 处方权限: 1-西药 2-中药 0-无 默认0
    var isPrescription: Int = 0
    /// 表示医生是否在线: 0-在线 1-离线 2-停诊
    var isOnline: SEDoctorOnlineStatus = .online
    /// 是否可以被预约: 0-否 1-是
    var isSubscribed: Int = 0
    var isDeleted: Int = 0
    /// 医院等别: 三甲
    var hospitalJb: String?
    /// 医院级别: 公立、私立
    var hospitalDb: String?
    
    var createTime: Date?
    var updateTime: Date?
    var creator: String?
    var `operator`: String?

    /**
     关注状态 1关注 2未关注
     */
    var status: Int = 2
    /// 医生头像
    var imgUrl: String?
    /// 医生排班列表
    var shifts: [SERegistrationDoctorModel] = []
    /// 评论
    var comments: SEDoctorCommentModel = SEDoctorCommentModel()
    
    var sex: Int = 0
}

struct SEDoctorCommentModel: HandyJSON {
    var list: [SEDoctorCommentDetail] = []
}

struct SEDoctorCommentDetail: HandyJSON {
    var createTime: String = ""
    var detail: String = ""
    var id: String = ""
    var rank: Int = 0
    var creatorName: String = " "
    var creatorPhoto: String = " "

}
